Skip to content

doctest: fix static build#455309

Closed
alois31 wants to merge 1 commit intoNixOS:masterfrom
alois31:push-xpoylyntomum
Closed

doctest: fix static build#455309
alois31 wants to merge 1 commit intoNixOS:masterfrom
alois31:push-xpoylyntomum

Conversation

@alois31
Copy link
Contributor

@alois31 alois31 commented Oct 24, 2025

One of the examples/tests doctest tries to build involves a dynamic library, which fails with the usual linker errors on static platforms. Disable them in this case to fix the build.

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 9.needs: reviewer This PR currently has no reviewers requested and needs attention. labels Oct 24, 2025
Comment on lines +32 to 36
cmakeFlags = lib.optionals stdenv.hostPlatform.isStatic [
(lib.cmakeBool "DOCTEST_WITH_TESTS" false)
];

doCheck = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cmakeFlags = lib.optionals stdenv.hostPlatform.isStatic [
(lib.cmakeBool "DOCTEST_WITH_TESTS" false)
];
doCheck = true;
cmakeFlags = [
(lib.cmakeBool "DOCTEST_WITH_TESTS" finalAttrs.finalPackage.doCheck)
];
doCheck = !stdenv.hostPlatform.isStatic;

Like this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In staging, as doctest is a mass rebuild.

@nixpkgs-ci nixpkgs-ci bot added 2.status: merge conflict This PR has merge conflicts with the target branch and removed 9.needs: reviewer This PR currently has no reviewers requested and needs attention. labels Nov 8, 2025
One of the examples/tests doctest tries to build involves a dynamic library,
which fails with the usual linker errors on static platforms. Disable them in
this case to fix the build.
@alois31
Copy link
Contributor Author

alois31 commented Nov 8, 2025

Ah, the duplicate #458967 has already been merged.

@alois31 alois31 closed this Nov 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.status: merge conflict This PR has merge conflicts with the target branch 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants